package Dao;
 
import java.sql.*;
import java.util.ArrayList;
import java.util.List;

import Dao.DBConn;
import Model.MemberBean;
import Model.SelectionBean;
 
public class SelectionDAO {
    private Connection conn; 
    public SelectionDAO() throws Exception {
        conn = DBConn.getConnection();
    }
    
    // 添加新课程安排
    public void insertSelection(SelectionBean select) throws Exception{
    	String sql = "insert into selection_information(SELECT_ID,SELECT_MEMBER_ID,SELECT_CURRICULUM_ID,SELECT_STATE) values(?,?,?,?)";
        try{	
            PreparedStatement prestmt = conn.prepareStatement(sql);
            prestmt.setInt(1, select.getSelectionID());
            prestmt.setInt(2, select.getSelectionMemberID());            
            prestmt.setInt(3, select.getSelectionCurriculumID());
            prestmt.setBoolean(4, select.getSelectionState());
            
            prestmt.execute();
            prestmt.close();
            conn.close();
        }catch (Exception e){
            e.getMessage();
        }
    }
    
 
}